/**
 * @Author :蕉绿
 * @Date : 2023/1/31 8:39
 * @Version : V1.0
 * @Description : homework
 */
public class Test {
    public static void main(String[] args) {
//        String str = "ab_a";
//        Boolean b = isPalindrome(str);
//        System.out.println(b);
//        System.out.println("Hello".length());
//        String s = "hello";
//        String str = "Hello";
//        System.out.println(s.equals(str));

        //数字转字符串
        String s1 = String.valueOf(123);
        String s2 = String.valueOf(true);

        //字符串转数字
        int n = Integer.parseInt("123");

        //字符串转数组
        String str = "hello";
        char[] ch = str.toCharArray();
        //数组转字符串
        String str2 = new String(ch);


    }
    public static boolean isPalindrome(String s) {


        StringBuilder sb = new StringBuilder(s.toLowerCase());
        StringBuilder a = new StringBuilder();
        String str = new String(sb);
        for(int i = 0; i < str.length(); i++) {
            if((str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') || (str.charAt(i) >= 'a' && str.charAt(i) <= 'z') || (str.charAt(i) >= '0' && str.charAt(i) <= '9') ) {
                a.append(str.charAt(i));
            }
        }
        String c = new String(a);
        String b = new String(a.reverse());
        return c.equals(b);


    }
}
